package com.longway.core.toolbox.wdp.msg;
import com.longway.core.toolbox.wdp.msg.bean.WdpAuth;
import com.longway.core.toolbox.wdp.msg.bean.WdpAuthTiket;
class AuthModelParser {

	private static enum AuthType {
		component_verify_ticket
	}
	
	protected WdpAuth parserMsg(MsgModel msgModel) {
		String infoTypeStr = msgModel.getInfoType().toLowerCase();
		AuthType infoType = AuthType.valueOf(infoTypeStr);
		if (AuthType.component_verify_ticket == infoType) {
			if("component_verify_ticket".equalsIgnoreCase(msgModel.getInfoType())){
				return new WdpAuthTiket(msgModel);
			}
		}
		throw new RuntimeException("暂不支持该类型的小程序授权事件！");
	}
}
